package com.example.demoserver.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.demoserver.entity.TrainQueoptions;
import com.example.demoserver.service.TrainQueoptionsService;
import com.example.demoserver.mapper.TrainQueoptionsMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 18364
* @description 针对表【train_queoptions】的数据库操作Service实现
* @createDate 2024-11-05 14:13:00
*/
@Service
public class TrainQueoptionsServiceImpl extends ServiceImpl<TrainQueoptionsMapper, TrainQueoptions>
    implements TrainQueoptionsService{
    @Autowired
    TrainQueoptionsMapper trainQueoptionsMapper;

    @Override
    public Integer deleteByQueId(Integer queId) {
        QueryWrapper<TrainQueoptions> queryWrapper=new QueryWrapper<>();
        queryWrapper.eq("queId",queId);
        return trainQueoptionsMapper.delete(queryWrapper);
    }

    @Override
    public Integer deleteAll() {
        QueryWrapper<TrainQueoptions> queryWrapper=new QueryWrapper<>();
        return trainQueoptionsMapper.delete(queryWrapper);
    }

    @Override
    public List<TrainQueoptions> selectByqueId(Integer queId) {
        QueryWrapper<TrainQueoptions> queryWrapper=new QueryWrapper<>();
        queryWrapper.eq("queId",queId);
        return trainQueoptionsMapper.selectList(queryWrapper);
    }
}




